//
//  MainViewController.m
//  iphonex
//
//  Created by zrb on 2018/3/8.
//  Copyright © 2018年 zrb. All rights reserved.
//

#import "MainViewController.h"
#import "ViewController.h"
#import "AppUtils.h"

@interface MainViewController ()

@end

@implementation MainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    NSLog(@"viewDidLoad");
    // Do any additional setup after loading the view.
    UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 100, 200)];
    [button setTitle:ApplicationName forState:UIControlStateNormal];
    [button addTarget:self action:@selector(holdDownButtonTouchDown:) forControlEvents:UIControlEventTouchDown];
    //延迟执行方法
//    [self performSelector:@selector(sendViewController) withObject:self afterDelay:2.0];
    
    [self.view addSubview:button];

}

- (void)holdDownButtonTouchDown:(UIButton *) sender
{
    [self sendViewController];
}

- (void)sendViewController {
    ViewController *vc = [[ViewController alloc] init];
    [self presentViewController:vc animated:YES completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
